<?php

include('includes/basic.php');

$module=$_POST['module'];
$desc=addslashes($_POST['module_desc']);
$user=$_SESSION['uid'];
	$s="select * from module_master where module='$module'";
	echo $s;
	$s_query=mysql_query($s);

		if(mysql_num_rows($s_query)>0)
		{
			echo "already exists";
		}
			else
			{

			$sql=mysql_query("insert into module_master(`module`,`module_desc`,`created_by`) values ('$module','$desc','$user')");
			
			}
	if($sql)
	{
	 header("location:view-module.php");
	}

?>